<!--头部公共部分-->
{include file="common/header" /}
<!--suppress ALL -->

<div style="padding:15px;font-size: 14px;">
    <form class="layui-form layui-form-pane">



        <div class="layui-form-item" style="text-align: center">


            <div class="layui-inline" >
                <div class="layui-input-inline" style="width:400px;">
                    <textarea type="text" style="padding-top: 10px;" placeholder="500字符以内"  name="content_area" value="" autocomplete="off"
                           class="layui-input">{$content_area}</textarea>
                </div>
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center">


            <div class="layui-inline" >
                <div class="layui-input-inline" style="width:400px;">
                    <textarea type="text" placeholder="备注" name="remarks_area"  style="height: 200px" value="" autocomplete="off"
                              class="layui-input">{$remarks_area}</textarea>
                </div>
            </div>
        </div>







        <div class="layui-form-item"  style="text-align: center">

                <a class="layui-btn layui-btn-normal" lay-submit lay-filter="sure">确定</a>
                <a class="layui-btn  layui-btn-primary" lay-submit lay-filter="cancel">取消</a>

        </div>
    </form>
</div>
<!--底部公共部分-->
{include file="common/footer" /}
<script>
    layui.use(['table','element', 'layedit', 'jquery', 'form', 'laydate', 'layer'], function () {
        let $ = layui.$,
            layer = layui.layer,
            form = layui.form,
            table = layui.table,
            element = layui.element,
            laydate = layui.laydate,
            jquery = layui.jquery;



        var id = '{$id}'; //节课ID
        //监听提交
        form.on('submit(sure)', function (data) {
            var field = {};
            field.content_area = $('textarea[name=content_area]').val();
            field.remarks_area = $('textarea[name=remarks_area]').val();
            field.id = id;
            $.ajax({
                url: '/admin/arranging/submit_Content',
                method: "post",
                data: field,
                beforeSend: function () {
                    isLoad = layer.load(0, {
                        shade: false
                    }); //0代表加载的风格，支持0-2
                },
                success: function (result) {
                    layer.msg(result.msg, {
                        time:2000
                    });
                    if (result.code === 1) {

                        setTimeout(function () {
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                        }, 1000)

                    }

                },
                complete: function () {
                    layer.close(isLoad)
                },
                error: function (error) {
                    console.log(error)
                }
            });

            return false;
        });


        //监听取消
        form.on('submit(cancel)', function (data) {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
            return false;
        });








    });


</script>
